home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Timing.a < prev    next >
Text File  |  1996-05-01  |  5KB  |  201 lines

  1. ;
  2. ;    File:        Timing.a
  3. ;
  4. ;    Contains:    Kernel Timing Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 8
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__TIMING__') = 'UNDEFINED' THEN
  19. __TIMING__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  25.  
  26. kDurationMicrosecond            EQU        -1                    ; Microseconds are negative 
  27. kDurationMillisecond            EQU        1                    ; Milliseconds are positive
  28. kDurationSecond                    EQU        1000                ; 1000 * durationMillisecond
  29. kDurationMinute                    EQU        60000                ; 60 * durationSecond,
  30. kDurationHour                    EQU        3600000                ; 60 * durationMinute,
  31. kDurationDay                    EQU        86400000            ; 24 * durationHour,
  32. kDurationNoWait                    EQU        0                    ; don't block
  33. kDurationForever                EQU        $7FFFFFFF            ; no time limit
  34.     IF OLDROUTINENAMES THEN
  35.  
  36. durationMicrosecond                EQU        -1
  37. durationMillisecond                EQU        1
  38. durationSecond                    EQU        1000
  39. durationMinute                    EQU        60000
  40. durationHour                    EQU        3600000
  41. durationDay                        EQU        86400000
  42. durationNoWait                    EQU        0
  43. durationForever                    EQU        $7FFFFFFF
  44.     ENDIF
  45. Nanoseconds                RECORD 0
  46. f                         ds        UInt64
  47. sizeof                     EQU *                    ; size:   $8 (8)
  48.                         ENDR
  49.  
  50.  
  51. ; typedef UInt32                         Ticks
  52.  
  53. ;
  54. ;    Time Information Routines
  55. ;
  56. ;
  57. ; extern AbsoluteTime UpTime(void )
  58. ;
  59.     IF GENERATINGCFM THEN
  60.         IMPORT_CFM_FUNCTION UpTime
  61.     ENDIF
  62.  
  63. ;
  64. ; extern AbsoluteTime TaskCPUTime(void )
  65. ;
  66.     IF GENERATINGCFM THEN
  67.         IMPORT_CFM_FUNCTION TaskCPUTime
  68.     ENDIF
  69.  
  70. ;
  71. ; extern void GetTimeBaseInfo(UInt32 *theMinAbsoluteTimeDelta, UInt32 *theAbsoluteTimeToNanosecondNumerator, UInt32 *theAbsoluteTimeToNanosecondDenominator, UInt32 *theProcessorToAbsoluteTimeNumerator, UInt32 *theProcessorToAbsoluteTimeDenominator)
  72. ;
  73.     IF GENERATINGCFM THEN
  74.         IMPORT_CFM_FUNCTION GetTimeBaseInfo
  75.     ENDIF
  76.  
  77. ;
  78. ;    Timing Conversion Routines
  79. ;
  80. ;
  81. ; extern Nanoseconds AbsoluteToNanoseconds(AbsoluteTime theAbsoluteTime)
  82. ;
  83.     IF GENERATINGCFM THEN
  84.         IMPORT_CFM_FUNCTION AbsoluteToNanoseconds
  85.     ENDIF
  86.  
  87. ;
  88. ; extern Duration AbsoluteToDuration(AbsoluteTime theAbsoluteTime)
  89. ;
  90.     IF GENERATINGCFM THEN
  91.         IMPORT_CFM_FUNCTION AbsoluteToDuration
  92.     ENDIF
  93.  
  94. ;
  95. ; extern AbsoluteTime NanosecondsToAbsolute(Nanoseconds theNanoseconds)
  96. ;
  97.     IF GENERATINGCFM THEN
  98.         IMPORT_CFM_FUNCTION NanosecondsToAbsolute
  99.     ENDIF
  100.  
  101. ;
  102. ; extern AbsoluteTime DurationToAbsolute(Duration theDuration)
  103. ;
  104.     IF GENERATINGCFM THEN
  105.         IMPORT_CFM_FUNCTION DurationToAbsolute
  106.     ENDIF
  107.  
  108. ;
  109. ; extern Nanoseconds DurationToNanoseconds(Duration theDuration)
  110. ;
  111.     IF GENERATINGCFM THEN
  112.         IMPORT_CFM_FUNCTION DurationToNanoseconds
  113.     ENDIF
  114.  
  115. ;
  116. ; extern Duration NanosecondsToDuration(Nanoseconds theNanoseconds)
  117. ;
  118.     IF GENERATINGCFM THEN
  119.         IMPORT_CFM_FUNCTION NanosecondsToDuration
  120.     ENDIF
  121.  
  122. ;
  123. ; extern Ticks AbsoluteToTicks(AbsoluteTime theAbsoluteTime)
  124. ;
  125.     IF GENERATINGCFM THEN
  126.         IMPORT_CFM_FUNCTION AbsoluteToTicks
  127.     ENDIF
  128.  
  129. ;
  130. ; extern AbsoluteTime TicksToAbsolute(Ticks theTicks)
  131. ;
  132.     IF GENERATINGCFM THEN
  133.         IMPORT_CFM_FUNCTION TicksToAbsolute
  134.     ENDIF
  135.  
  136. ;
  137. ;    AbsoluteTime Adjustment Routines
  138. ;
  139. ;
  140. ; extern AbsoluteTime AddAbsoluteToAbsolute(AbsoluteTime theAbsoluteTime1, AbsoluteTime theAbsoluteTime2)
  141. ;
  142.     IF GENERATINGCFM THEN
  143.         IMPORT_CFM_FUNCTION AddAbsoluteToAbsolute
  144.     ENDIF
  145.  
  146. ;
  147. ; extern AbsoluteTime SubAbsoluteFromAbsolute(AbsoluteTime theLeftAbsoluteTime, AbsoluteTime theRightAbsoluteTime)
  148. ;
  149.     IF GENERATINGCFM THEN
  150.         IMPORT_CFM_FUNCTION SubAbsoluteFromAbsolute
  151.     ENDIF
  152.  
  153. ;
  154. ; extern AbsoluteTime AddNanosecondsToAbsolute(Nanoseconds theNanoseconds, AbsoluteTime theAbsoluteTime)
  155. ;
  156.     IF GENERATINGCFM THEN
  157.         IMPORT_CFM_FUNCTION AddNanosecondsToAbsolute
  158.     ENDIF
  159.  
  160. ;
  161. ; extern AbsoluteTime AddDurationToAbsolute(Duration theDuration, AbsoluteTime theAbsoluteTime)
  162. ;
  163.     IF GENERATINGCFM THEN
  164.         IMPORT_CFM_FUNCTION AddDurationToAbsolute
  165.     ENDIF
  166.  
  167. ;
  168. ; extern AbsoluteTime SubNanosecondsFromAbsolute(Nanoseconds theNanoseconds, AbsoluteTime theAbsoluteTime)
  169. ;
  170.     IF GENERATINGCFM THEN
  171.         IMPORT_CFM_FUNCTION SubNanosecondsFromAbsolute
  172.     ENDIF
  173.  
  174. ;
  175. ; extern AbsoluteTime SubDurationFromAbsolute(Duration theDuration, AbsoluteTime theAbsoluteTime)
  176. ;
  177.     IF GENERATINGCFM THEN
  178.         IMPORT_CFM_FUNCTION SubDurationFromAbsolute
  179.     ENDIF
  180.  
  181. ;
  182. ;    Timing Delta Routines
  183. ;
  184. ;
  185. ; extern Nanoseconds AbsoluteDeltaToNanoseconds(AbsoluteTime theLeftAbsoluteTime, AbsoluteTime theRightAbsoluteTime)
  186. ;
  187.     IF GENERATINGCFM THEN
  188.         IMPORT_CFM_FUNCTION AbsoluteDeltaToNanoseconds
  189.     ENDIF
  190.  
  191. ;
  192. ; extern Duration AbsoluteDeltaToDuration(AbsoluteTime theLeftAbsoluteTime, AbsoluteTime theRightAbsoluteTime)
  193. ;
  194.     IF GENERATINGCFM THEN
  195.         IMPORT_CFM_FUNCTION AbsoluteDeltaToDuration
  196.     ENDIF
  197.  
  198.     ENDIF
  199.     ENDIF ; __TIMING__ 
  200.  
  201.